<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../lib/vue2.5.15.js"></script>
    <style>
        .fade-enter-active, .fade-leave-active {
            transition: opacity 1s;

        }
        .fade-enter, .fade-leave-to {
            opacity: 0;
        }

        /*指定显示效果*/
        .move-enter-active{
            transition: all 1s;
        }
        .move-leave-active{
            transition: all 3s;
        }
        .move-enter {
            opacity: 0;
            transform: translateX(10px);
        }
        .move-leave {
            opacity: 0;
            transform: translateX(10px);
        }

        .bounce-enter-active {
            animation: bounce-in 1.5s;
        }
        .bounce-leave-active {
            animation: bounce-in 1.5s reverse;
        }
        @keyframes bounce-in {
            0% {
                transform: scale(0);
            }
            50% {
                transform: scale(1.5);
            }
            100% {
                transform: scale(1);
            }
        }
    </style>
</head>
<body>
<div id="app">
    <div v-show=false>
        <button @click="show = !show">
            切换
        </button>
        <!--1、哪个部分需要过渡显示，就把那部分代码用<transition>标签包裹起来-->
        <!--2、定义css样式
            enter为最终显示
            leave为最终隐藏

            enter-active，leave-active为从隐藏到显示，从显示到隐藏这个过程中的样式
        -->
        <transition name="fade">
            <p v-if="show">hello</p>
        </transition>
    </div>
    <div v-show=false>
        <button @click="show = !show">
            切换
        </button>

        <transition name="move">
            <p v-if="show">hello</p>
        </transition>
    </div>

    <div v-show=true>
        <button @click="show = !show">Toggle show</button>
        <transition name="bounce">
            <p v-if="show">Lorem ipsum<br> dolor sit amet</p>
        </transition>
    </div>

</div>
</body>
<script>
    const vm = new Vue(
        {
            el:"#app",
            data:{
                show: true
            },
            methods:{

            }
        }
    )
</script>
</html>